/*
 * Copyright (c) @ justbk. 2021-2031. All rights reserved.
 */

import org.junit.Test;

/**
 * Title: the ExcptionTest class.
 * <p>
 * Description:
 *
 * @author justbk
 * @version [issueManager 0.0.1, 2022/9/16]
 * @since 2022/9/16
 */
public class ExcptionTest {
    public static class MyException extends Exception {
        @Override
        public String toString() {
            return "myExp";
        }
    }
    private void throwExp() throws Exception {
        throw new MyException();
    }
    @Test
    public void test1() throws Exception {
        try {
            throwExp();
        } catch (MyException exp) {
            System.out.println("aaa" + exp);
            exp.printStackTrace();
//        } catch (Exception exp) {
//            System.out.println("bbb" + exp);
//            exp.printStackTrace();
        }
    }
}
